# http://cran.r-project.org/ AND DOWNLOAD THE R LATEST RELEASE: R-2.x.y.
# http://www.staff.ul.ie/mackenzieg/Assess/R_Integration_Tools/r_integration_tools.html (Crash Course in R)

y <- c(0,0,0,4,4,5,5,5,6,6,6,6,6,6,6)
n <- 15
nb<-1000
boot<-matrix(NA,nb,3)
attributes(boot)

for (i in 1:nb)
{
bs<-sample(y,n,replace =T)
boot[i,1]<- median(bs)
boot[i,2]<- mean(bs)
}
hist(boot[,1])
hist(boot[,2])
quantile(boot[,1], probs=0.025)
quantile(boot[,1], probs=0.975)
quantile(boot[,2], probs=0.025)
quantile(boot[,2], probs=0.975)
